


#ifndef AUTOCOMPLETE_H
#define AUTOCOMPLETE_H


class AutoComplete {
	bool active;
	char stopChars[256];
	char fillUpChars[256];
	char separator;
	char typesep; 
public:
	bool ignoreCase;
	bool chooseSingle;
	ListBox *lb;
	int posStart;
	int startLen;

	bool cancelAtStartPos;
	bool autoHide;
	bool dropRestOfWord;

	AutoComplete();
	~AutoComplete();


	bool Active();


	void Start(Window &parent, int ctrlID, int position, Point location,
		int startLen_, int lineHeight, bool unicodeMode);


	void SetStopChars(const char *stopChars_);
	bool IsStopChar(char ch);


	void SetFillUpChars(const char *fillUpChars_);
	bool IsFillUpChar(char ch);


	void SetSeparator(char separator_);
	char GetSeparator();


	void SetTypesep(char separator_);
	char GetTypesep();


	void SetList(const char *list);

	void Show(bool show);
	void Cancel();


	void Move(int delta);


	void Select(const char *word);
};

#endif
